<?
ob_start();
session_start();
include("conf/config.php");
include("conf/database.php");
include("conf/tools.php");

$curTime=getIndianDateTime();
$news_id=$_GET["event_id"];
$mode=$_GET["mode"]; 

foreach($_POST as $key => $value) { $arr_data[$key]=$value;}
foreach($arr_data as $key => $value) { $arr_data[$key]=addslashes($value); }

$event_id=$_GET["event_id"];
//$event_info=@array_pop(qry_data("select * from bkit_news where rec_status>=1 and news_id=".$event_id));
$arr_data["reg_status"]=1;
$arr_data["event_id"]=$event_id;

$reg_id=insert_qry("bkitc_event_registration",$arr_data);

qry_data("update bkitc_event_registration set reg_date='".$curTime."' where reg_id=".$reg_id);

$news_info=@array_pop(qry_data("select * from bkit_news where news_id=".$event_id));
$arr_data["event_title"]=$news_info["news_title"];
$arr_data["event_admin_email"]=$news_info["event_admin_email"];

send_event_notification($arr_data);
header("location:event_register.php?mode=1&event_id=".$event_id);
?>



